package com.hk.springtrains.mail;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.mail.javamail.JavaMailSenderImpl;

@Configuration
@ComponentScan
public class MailConfig {

    @Bean
    public JavaMailSenderImpl mailSender(){
        JavaMailSenderImpl javaMailSender = new JavaMailSenderImpl();
        javaMailSender.setHost("smtp.126.com");
        javaMailSender.setPort(25);
        javaMailSender.setUsername("dujiang516@126.com");
        javaMailSender.setPassword("dj516615dj");
        return  javaMailSender;
    }







}
